package ess

import (
	"fmt"
	"github.com/elastic/go-elasticsearch"
	"zc/rpc/global"
)

func Es() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://1.94.144.57:9200",
		},
	}

	global.ElasticClient, err = elasticsearch.NewClient(cfg)
	// ...
	if err != nil {
		fmt.Println("es 连接失败", err)
		return
	}
	fmt.Println("es 连接成功")
}
